package com.example.admin.yuejian21.Model;



import com.example.admin.yuejian21.Bean.Activity;
import com.example.admin.yuejian21.Bean.ActivityDetail;
import com.example.admin.yuejian21.Service.Service;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Lee1 on 2017/10/19.
 */

public class ActivityModel {
    private Retrofit retrofit;
    public ActivityModel(){
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }
    public Call<List<Activity>> getactivityList(String s){
        Service Service = retrofit.create(Service.class);
        return Service.getActivityList();
    }
    public Call<ActivityDetail> getactivityDetail(String id){
        Service Service = retrofit.create(Service.class);
        return Service.getActivityDetail("um22daeuj1859g6bljcjruk9g0","activity",id);
    }
    public Call<Integer> signAct(String participantname,String act_id,String participanttel,String adultnum,String studentnum,String paytype,
                                 String pay,String paynotice,int userid){
        Service Service = retrofit.create(Service.class);
        return Service.signAct("signactivity",participantname,act_id,participanttel,adultnum,studentnum,paytype,pay,paynotice,"保险详细内容",userid,"lgj98rfkiqvenhrk2o7oe2po81");
    }
}
